<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">

    <div th:replace="~{/home::css_js}"></div>
</head>
<body>
<div id="wrapper">

    <div th:replace="~{/home::topbar}"></div>

    <div th:replace="~{/home::sidebar}"></div>

    <div class="main">
        <!-- MAIN CONTENT -->


        <div class="main-content">
            <div class="container-fluid">
                <div id="page-wrapper">
                    <div id="page-inner">
                        <div class="row">
                            <div class="col-md-12">
                                <h1 class="page-header">
                                    修改管理员信息
                                </h1>
                            </div>
                            <div class="row">
                                <div class="col-lg-12"> <!--把col lg 12宽 分成了 左边6 右边6-->
                                    <div class="panel panel-default">
                                        <div class="panel-heading"> <!--panel顶部一整行-->
                                            正在修改管理员 [[${admin.getUsername()}]]
                                        </div>
                                        <div class="panel-body">
                                            <div class="row">         <!--form 表单的开始-->
                                                <div class="col-lg-11">          <!--thymeleaf页面要绑定所有的url，否则报403-->
                                                    <form role="form" th:action="@{'/admin/modify_admin_do/'+${admin.getAdmin_id()}}" method="post">
                                                        <input th:type="hidden" th:value="${admin.getUsername()}" name="username">
                                                        <div class="form-group">
                                                            <!--发现，输入文字的，选择的控件<input class="form-control">-->
                                                            <label>设置密码</label>
                                                            <input class="form-control" th:type="text" name="password"
                                                                   required="required" th:value="${admin.getPassword()}">
                                                        </div>
                                                        <div class="form-group">
                                                            <label>管理员角色</label>
                                                            <select class="form-control" th:name="role" size="1">
                                                                <option value="1" th:text="系统管理员" th:selected="${admin.getRole()==1?true:false}"></option>
                                                                <option value="2" th:text="商品管理员" th:selected="${admin.getRole()==2?true:false}"></option>
                                                            </select>
                                                        </div>
                                                        <div class="form-group">
                                                            <label>账号状态</label>
                                                            <input name="state" th:type="radio" value="1" th:checked="${admin.getState()==1?true:false}">启用
                                                            <input name="state" th:type="radio" value="2" th:checked="${admin.getState()==2?true:false}">冻结
                                                        </div>
                                                        <div class="form-group">
                                                            <!--发现，输入文字的，选择的控件<input class="form-control">-->
                                                            <label>姓名</label>
                                                            <input class="form-control" th:type="text" name="realname" th:value="${admin.getRealname()}">

                                                        </div>

                                                        <div class="form-group">
                                                            <!--发现，输入文字的，选择的控件<input class="form-control">-->
                                                            <label>联系电话</label>
                                                            <input class="form-control" th:type="text" name="phone" th:value="${admin.getPhone()}">
                                                        </div>
                                                        <div class="form-group">
                                                            <!--发现，输入文字的，选择的控件<input class="form-control">-->
                                                            <label>邮箱</label>
                                                            <input class="form-control" th:type="text" name="email" th:value="${admin.getEmail()}">
                                                        </div>

                                                        <button type="submit" class="btn btn-success">提交</button>
                                                        <a class="btn btn-danger" th:href="@{'/admin/delete_admin/'+${admin.getAdmin_id()}}">删除</a>
                                                        <a class="btn btn-primary" th:href="@{${admin.getRole()==1?'/admin/admin_sys':'/admin/admin_mall'}}">取消</a>
                                                    </form>
                                                    <!--form表单结束-->
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

</div>
</body>
</html>